import store from "@/store";

const { body } = document
const WIDTH = 992

export default {
    beforeMount(){
        window.addEventListener('resize', this.resizeHandler)
    },
    beforeDestroy() {
        window.removeEventListener('resize', this.resizeHandler)
    },
    mounted() {
        this.resizeHandler()
    },

    methods: {
      resizeHandler(){
          const rect = body.getBoundingClientRect()
          let winSize = {
              height: rect.height,
              width: rect.width
          }
          store.dispatch("app/setWinSize", winSize)
          console.log(winSize)
      }
    }
}
